Skip to content

Fix stale playout state across multi-step voice turns#5533

Open
jayeshp19 wants to merge 2 commits intolivekit:mainfrom
jayeshp19:Fix-stale-playout-state-across-multi-step-voice-turns
Open

Fix stale playout state across multi-step voice turns#5533
jayeshp19 wants to merge 2 commits intolivekit:mainfrom
jayeshp19:Fix-stale-playout-state-across-multi-step-voice-turns

Conversation

@jayeshp19
Copy link
Copy Markdown
Contributor

@jayeshp19 jayeshp19 commented Apr 23, 2026

This PR fixes a bug where paused-speech state could become stale across generation steps within a single SpeechHandle. The key changes are:

  1. New current_generation_playout_active flag on SpeechHandle — tracks whether the current generation's audio is actively playing, reset on each step advance.
  2. New generation_step field on _PausedSpeechInfo — ensures paused speech is only applied/resumed if it matches the current generation step.
  3. Centralized _on_generation_playout_started / _on_generation_playout_finished — extracts duplicated playout lifecycle logic (state updates, audio recognition notifications, interruption toggling) into two reusable methods.

The audio-interruption condition now also gates on current_generation_playout_active, preventing interruptions when the agent isn't actually playing audio for the current generation.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

@jayeshp19 jayeshp19 force-pushed the Fix-stale-playout-state-across-multi-step-voice-turns branch from efc3ae3 to efcb35c Compare April 24, 2026 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant